import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path"
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    hmr: true,
    port: 3001,
    proxy: {
      '/csdn': {  // 这里修改为代理 /csdn 而不是 /api
        target: "http://localhost:8080/",  // 目标代理接口
        secure: false,
        changeOrigin: true,
        pathRewrite: {
          '^/csdn': '/csdn',
        },
      },

    },
  },
  resolve:{
    alias:{
      '@':path.resolve(__dirname,'./src'),
    },
  },
})
